<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>操作结果</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f4f9;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }
        .container {
            background-color: #fff;
            padding: 30px;
            border-radius: 12px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
            text-align: center;
            max-width: 500px;
            width: 100%;
        }
        h1 {
            color: #4CAF50;
            font-size: 28px;
            margin-bottom: 20px;
            text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
        }
        p {
            font-size: 16px;
            color: #555;
            margin-bottom: 20px;
        }
        .button-link {
            display: inline-block;
            padding: 12px 30px;
            background-color: #4CAF50;
            color: white;
            text-decoration: none;
            font-size: 16px;
            font-weight: bold;
            border-radius: 8px;
            transition: background-color 0.3s, transform 0.3s;
        }
        .button-link:hover {
            background-color: #45a049;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        }
        .button-container {
            margin-top: 20px;
        }
        hr {
            border: 0;
            height: 1px;
            background-color: #ddd;
            margin: 20px 0;
        }
    </style>
</head>
<body>
<%
    HttpSession sessionForOk = request.getSession(false); // false 表示如果没有 session 则返回 null
    String ok = (String) sessionForOk.getAttribute("ok");
%>
<div class="container">
    <h1><%= ok %>成功！</h1>
    <p>
        <% if ("增加新用户".equals(ok)) { %>
        操作已成功完成，点击下方按钮登录系统。
        <% } else { %>
        操作已成功完成，可返回上一页继续进行操作。
        <% } %>
    </p>
    <hr>
    <div class="button-container">
        <% if ("增加新用户".equals(ok)) { %>
        <a href="index.jsp" class="button-link">登录</a>
        <% } else { %>
        <a href="${pageContext.request.contextPath}/AdminHomeServlet" class="button-link">继续操作</a>
        <% } %>
    </div>
</div>
</body>
</html>
